import { $post, $put } from '@js/authRequest'

export async function addRequest (data) {
  const res = await $post('/api/xapc/live', data)
  if (res.status !== 1) {
    throw new Error(res.message)
  }
  return res.data
}

export async function updateRequest (id, data) {
  const res = await $put(`/api/xapc/live/${id}`, data)
  if (res.status !== 1) {
    throw new Error(res.message)
  }
  return res.data
}
